package io;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

/**
 * 使用对象的输入流进行对象的反序列化
 * 返序列化：将一组字节还原为Java对象
 */
public class OISDemo {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("student.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);

        Object o = ois.readObject();

        Student s = (Student) o;
        System.out.println(o);
        ois.close();
    }
}
